<template>
    <!-- 验收申请弹窗 -->
    <el-dialog
        width="1200px"
        title="工程选择清单"
        :visible.sync="show"
        :close-on-click-modal="false"
        @close="handleClose"
    >
        <el-collapse v-model="activeNames">
            <el-collapse-item
                v-for="(item, index) in collapseConfig"
                :key="item.comp"
                :title="item.label"
                :name="index"
            >
                <div slot="title" v-if="item.comp !== 'BudgetBaseInfo'">
                    <span class="header-label">{{ item.label }}</span>
                    <input
                        type="file"
                        v-if="item.btnId"
                        :id="item.btnId"
                        :disabled="uploadBtnDisabled[item.btnId]"
                        class="import-btn"
                        @click="e => e.stopPropagation()"
                        @change="importTemp(item.btnId)"
                    />
                    <el-button
                        v-for="(btn, index) in ['导入', '下载模板']"
                        :key="btn"
                        :disabled="!index && uploadBtnDisabled[item.btnId]"
                        :loading="!index && submitImportFlg == item.btnId"
                        @click.stop="index && down(item.btnId)"
                        type="primary"
                        size="mini"
                    >
                        {{ btn }}
                    </el-button>
                </div>
                <component :ref="item.comp" :is="item.comp" :data="data"></component>
            </el-collapse-item>
        </el-collapse>
        <div slot="footer">
            <div align="center">
                <el-button
                    v-for="(item, index) in detailBtns"
                    :key="`detailBtns${index}`"
                    :type="item.type"
                    size="small"
                    @click="item.click"
                >
                    {{ item.label }}
                </el-button>
            </div>
        </div>
    </el-dialog>
</template>

<script>
import SelectProjectBudgetDialog from './SelectProjectBudgetDialog';
export default SelectProjectBudgetDialog;
</script>
<style lang="less" scoped>
@import './SelectProjectBudgetDialog.less';
</style>
